package com.cjm.lecode;

public class ReversStr {
    public static void reversString(char[] s) {
        int i = 0;
        int j = s.length - 1;
        while (i <= j) {
            char ic = s[i];
            char jc = s[j];
            s[i] = jc;
            s[j] = ic;
            i++;
            j--;
        }
    }

    public static void main(String[] args) {
        char[] a = {'h', 'e', 'l', 'l', 'o'};
        char[] b = {'H', 'a', 'n', 'n', 'a', 'h'};
        reversString(a);
        reversString(b);
        System.err.println(a.toString());
        System.err.println(b.toString());
    }
}
